Repository navigation
feat(flagd-core): add terminal resolve operator - #486
Draft
marcozabel wants to merge 3 commits into
Draft
marcozabel wants to merge 3 commits into
marcozabel wants to merge 3 commits into
Conversation
The json_logic builtin raises ZeroDivisionError, which fails the whole evaluation. JavaScript, and the Go and Java flagd cores, return Infinity or NaN instead. Signed-off-by: marcozabel <marco.zabel@dynatrace.com>
{"resolve": ["variant", "reason"?, [["key", value], ...]?]} selects a
variant, optionally overrides the reason and adds rule metadata over
flag and flag set metadata. It works as the whole rule, an if result or
a fractional bucket variant. Malformed computed arguments fall back to
the default variant, and rule metadata can't override the reserved
flagSetId and version keys.
Refs: open-feature#460
Signed-off-by: marcozabel <marco.zabel@dynatrace.com>
Pin the test harness to flagd-testbed#448 (unreleased) for the @resolve scenarios. The released testbed image has no resolve launchpad config, so file mode reads the harness flag file directly, and RPC and in-process skip @resolve until a testbed release ships it. "the resolved metadata should contain" now checks only the listed keys, since resolve flags also carry flag set metadata. Signed-off-by: marcozabel <marco.zabel@dynatrace.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #486 +/- ##
==========================================
- Coverage 96.16% 92.07% -4.10%
==========================================
Files 47 17 -30
Lines 1798 555 -1243
==========================================
- Hits 1729 511 -1218
+ Misses 69 44 -25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #460. Part of open-feature/flagd#2090.
Adds
{"resolve": ["variant", "reason"?, [["key", value], ...]?]}, matching open-feature/flagd#2127 and open-feature/java-sdk-contrib#1979. It can be the whole rule, anifresult or afractionalbucket variant. Rule metadata takes precedence over flag metadata, which takes precedence over flag-set metadata;flagSetIdandversionare never overridden. Malformed computed arguments fall back to the default variant.Also makes
/by zero return ±Inf/NaN like the other cores, instead of raising.Before merge: move the test-harness pin from open-feature/flagd-testbed#448 to a release, then re-enable
@resolvefor in-process and RPC.